/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.io.File;

/**
 * <p>Project: javase - Dir4
 * <p>Powered by webrx On 2021-12-13 15:42:00
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Dir4 {
    public static void main(String[] args) {
        //统计一个目录中有多少个java文件
        var path = "c:/javase";
        var file = new File(path);
        //System.out.println(file.isFile());
        //System.out.println(file.exists());
        //System.out.println(file.isDirectory());
        var fns = file.listFiles();
        for (File f : fns) {
            System.out.printf("%s(%s)%n", f.getName(), f.isFile() ? "文件" : "目录");
        }
    }
}
